home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 121_01 / plot.h < prev    next >
Text File  |  1985-08-19  |  2KB  |  86 lines

  1. /*
  2.  * plot.h - header file for the JTL printer graphics (epson flavor)
  3.  *    code.
  4.  *    copyright (c) 1982, JTL Computer Services
  5.  *    2/82 - mwm
  6.  *
  7.  * version 1.0:    September 1985
  8.  *    added version number
  9.  *    added #defines from plot.inc header
  10.  *
  11.  *    this header is used by plot.c
  12.  */
  13.  
  14. /*
  15.  * defines for the user of the line  genline routines
  16.  */
  17. #define UP    0
  18. #define DOWN    1
  19. #define TEXT    2
  20. #define ENDPLOT    9
  21.  
  22. /*#define HIDEN        on for 960 dots per line, off for 480 */
  23. #define COMPRESS    on for compressed text, off for normal text */
  24.  
  25. #ifdef    HIDEN
  26. #define    LINELEN    960
  27. #define PAGELEN    24
  28. #define LENSTR    "%cL"
  29. #else
  30. #define    LINELEN    480
  31. #define PAGELEN    792
  32. #define LENSTR    "%cK"
  33. #endif
  34.  
  35. #ifdef    COMPRESS
  36. #define CDEN    2/7    /* don't parenthesize this! */
  37. #define CLEN    7/2
  38. #define CHARS    131
  39. #else
  40. #define CDEN    1/6    /* or this!!!!!!! */
  41. #define CLEN    7/2
  42. #define CHARS    79
  43. #endif
  44.  
  45. #define VDEN    8    /* # of vertical dots on a line */
  46. #define PLEN    (PAGELEN / VDEN + ((PAGELEN % VDEN) ? 1 : 0))
  47. #define ESC    0x1b
  48. /*
  49.  * the mapping for the symbol table on any given plot is as follows -
  50.  *    using symbol, plotsym (and tagsym), you get the symbols from
  51.  *    1 to MAXSYM (this ought to be 255). Using plots, plotc (and tag)
  52.  *    you get the characters from 1 to SYMSEP (ought to be 127, or DEL)
  53.  *    and the symbols from SYMSEP+1 to MAXSYM. Note that the symbol
  54.  *    routines are set up to handle strings, or arrays of chars, so MAXSYM
  55.  *    CANNOT be larger thatn 255 (unless you change the code...)
  56.  */
  57. #define MAXSYM    255
  58. #define    SYMSEP    127    /* last valid ascii character */
  59. #define    SYMLEN    6    /* length of a non-compressed charcter in dots */
  60. /*
  61.  * the symbol table structure. MAXSYM per plot page.
  62.  */
  63. #define symtab    struct SYMTAB
  64. symtab {
  65.     char    s_symbol[SYMLEN] ;
  66.     char    s_def ;            /* is this defined? */
  67.     } ;
  68. /*
  69.  * this structure holds one print line of a plot
  70.  */
  71. #define plotline STRUCT PLOTLINE
  72. plotline {
  73.     char    *p_points ;        /* the points to plot on this line */
  74.     char    *p_text ;        /* optional text to put on the line */
  75.     } ;
  76. /*
  77.  * The actual plot structure - holds all the info needed to plot a window
  78.  */
  79. #define plot    STRUCT PLOT
  80. plot {
  81.     int        p_xmax, p_ymax ;    /* edges of the plot ... */
  82.     plotline    p_page[PLEN] ;
  83.     int        p_x, p_y ;        /* current "pen" positions */
  84.     symtab        p_symtab[MAXSYM] ;    /* symbol table */
  85.     } ;
  86.